package com.wss.module.user.ui.main.mvp;

import com.wss.common.base.BaseApplication;
import com.wss.common.base.mvp.BasePresenter;
import com.wss.common.utils.ToastUtils;
import com.wss.module.user.ui.main.mvp.contract.UserContract;
import com.wss.module.user.ui.main.mvp.model.UserModel;
import ohos.app.dispatcher.TaskDispatcher;
import ohos.app.dispatcher.task.Revocable;
import ohos.app.dispatcher.task.TaskPriority;
import ohos.eventhandler.EventHandler;
import ohos.eventhandler.EventRunner;

/**
 * Describe：我的Presenter
 * Created by 吴天强 on 2018/11/21.
 */

public class  UserPresenter extends BasePresenter<UserModel, UserContract.View>
        implements UserContract.Presenter {

    @Override
    public void checkUpdate() {
        showLoading();
        TaskDispatcher globalTaskDispatcher = BaseApplication.i().getGlobalTaskDispatcher(TaskPriority.DEFAULT);

        new EventHandler(EventRunner.getMainEventRunner()).postTask(new Runnable() {
            @Override
            public void run() {
                dismissLoading();
                ToastUtils.show("已是最新版本~");
            }
        },1200);

    }

    @Override
    protected UserModel createModule() {
        return new UserModel(getLifecycleOwner());
    }

    @Override
    public void start() {

    }
}
